package com.bridge.client.bridgedynamcclient.controller;

import com.bridge.client.bridgedynamcclient.controller.BaseController;
import com.bridge.client.bridgedynamcclient.controller.BridgeAddMainController;
import com.bridge.client.bridgedynamcclient.utils.FXMLUtil;
import javafx.fxml.FXML;
import javafx.fxml.FXMLLoader;
import javafx.fxml.Initializable;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.layout.AnchorPane;
import javafx.stage.Modality;
import javafx.stage.Stage;

import java.io.IOException;
import java.net.URL;
import java.util.ResourceBundle;

public class BridgeDynamcController extends BaseController implements Initializable {

    @FXML
    private Button btnAddBridge;
    @FXML
    private Button btnBridgeList;
    @FXML
    private Button btnUploadFile;

    @Override
    public void initialize(URL url, ResourceBundle resourceBundle) {
        initListener();
    }

    private void initListener()  {

        btnAddBridge.setOnAction(a->{

            FXMLLoader loader = FXMLUtil.getLoader(getClass(), "bridge-add-main-view.fxml");
            FXMLUtil.loadView(loader);
        });

        btnBridgeList.setOnAction(a->{
            FXMLLoader loader = FXMLUtil.getLoader(getClass(), "bridge-record-list-view.fxml");
            FXMLUtil.loadView(loader);
        });

        btnUploadFile.setOnAction(a->{
            FXMLLoader loader = FXMLUtil.getLoader(getClass(), "bridge-upload-file-view.fxml");
            FXMLUtil.loadView(loader);
        });
    }

}